Skip to content

feat(nodes): add NVIDIA Nemotron LLM node - #1766

Open
Leela8256 wants to merge 5 commits into
developfrom
feat/llm-nemotron
Open

feat(nodes): add NVIDIA Nemotron LLM node#1766
Leela8256 wants to merge 5 commits into
developfrom
feat/llm-nemotron

Conversation

@Leela8256

@Leela8256 Leela8256 commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Closes #1765

Summary

Adds llm_nemotron, a dedicated LLM node for NVIDIA's Nemotron family — open-weight hybrid Mamba-Transformer reasoning models with up to 1M-token context — served through NVIDIA's OpenAI-compatible cloud API (build.nvidia.com, nvapi- keys) or self-hosted via NIM containers / vLLM / SGLang.

What's in

Node (nodes/src/nodes/llm_nemotron/)

  • services.json: questions → answers lane; profiles for Nemotron 3 Super 120B (default), Ultra 550B, Nano 30B — all flagged capabilities.reasoning — plus a Custom profile and two self-hosted (Local) profiles. NIM containers serve the same model IDs as the hosted API, so local profiles reuse the cloud model strings against http://localhost:8000/v1.
  • IGlobal: save-time 1-token validation probe with structured OpenAI-exception → user-facing error mapping. Probe only runs for cloud endpoints; key presence (not format) is enforced — NVIDIA keys use nvapi-, not sk-.
  • nemotron.py: Chat(ChatBase) via langchain_openai.ChatOpenAI; strips <think>…</think> blocks so downstream nodes only see the final answer (the hosted API returns reasoning in reasoning_content, so the strip is a safety net for self-hosted servers).
  • IInstance (LLMBase), __init__, requirements.txt, brand icon (two-color so the monochrome auto-theming leaves NVIDIA green intact), README with generated params block.

Model sync (tools/sync_models/)

  • NemotronProvider + registry entries + config block (ROCKETRIDE_NVIDIA_KEY).
  • NVIDIA's /v1/models lists a full multi-vendor catalog (Llama, GLM, Kimi, Mistral, …), so the model filter includes only nvidia/*nemotron* chat models and excludes vl/vision/omni/safety/guard/parse/ocr/embed/rerank/retriever/asr/tts/speech/audio/reward variants.
  • Context locks (1M / 1M / 256K) and 32K output-token pins (NVIDIA publishes no output limits; the 4096 default is too small for reasoning models). Protected profiles cover the seeded set so keyless fallback runs can never retire them.

Integration

  • ROCKETRIDE_NVIDIA_KEY mapped in the sync-models workflow (partition + strict env blocks).
  • Mock credential in the node-test framework; requires_nvidia marker + live profile-existence test.
  • Catalog row in docs/README-nodes.md; provider row in the sync README.

Testing

  • nodes/test/test_contracts.py: 316/316 pass (node contract + module import).
  • builder nodes:test --pytest-pattern=llm_nemotron: engine-level run green (mocked LLM path).
  • Live API: all seeded model IDs verified against /v1/models; 1-token probe and real completions confirmed; test_nemotron_profiles_exist_in_api passes with a real key.
  • sync_models --provider llm_nemotron --model-source provider dry run reports no changes after the checked-in profiles.
  • End-to-end through a local engine: plain chat pipeline, agent LLM-control binding (agent_langchain, agent_llamaindex), tool_chartjs LLM binding, nested sub-agent orchestration, multiple llm_nemotron nodes with different profiles in one pipeline, webhook-source pipelines, Custom-profile connections (cloud + custom base URL), 5-way concurrent requests on one instance, and clean surfaced errors for invalid keys (403) and unknown models (404). Self-hosted profile path verified against a local OpenAI-compatible mock server.
  • ruff check / ruff format clean; services JSONC validated.

Follow-ups (not in this PR)

  • Add a ROCKETRIDE_NVIDIA_KEY Actions secret to enable native discovery/smoke-testing in the weekly sync (without it, the provider is enriched via fallback).
  • Optional companion vision node for the Nemotron VL/Omni multimodal variants.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added NVIDIA Nemotron reasoning model support.
    • Added cloud and self-hosted deployment options for Nano, Super, Ultra, and custom profiles.
    • Added automatic model synchronization from NVIDIA’s API.
    • Removed reasoning markup from generated responses for cleaner answers.
  • Documentation

    • Added setup, configuration, deployment, and provider documentation for Nemotron.
  • Bug Fixes

    • Improved connection validation with clearer provider error messages.

Adds llm_nemotron: NVIDIA's Nemotron reasoning models via the
OpenAI-compatible build.nvidia.com API, with self-hosted NIM/vLLM
profiles, filtered sync_models integration, CI key wiring, tests,
and docs.

Closes #1765

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Leela8256 Leela8256 added feature New feature or enhancement nodes Pipeline nodes module:nodes Python pipeline nodes labels Jul 31, 2026
@github-actions

Copy link
Copy Markdown
Contributor
🤖 Internal: Discord sync marker

Auto-managed by the Discord notification workflow. Stores the linked Discord message ID and forum thread ID. Do not edit or delete.

@github-actions github-actions Bot added docs Documentation ci/cd CI/CD and build system labels Jul 31, 2026
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 1831bc99-7efe-4e0a-93df-21c26d6a14c6

📥 Commits

Reviewing files that changed from the base of the PR and between e7ac4bf and 46cfe6e.

📒 Files selected for processing (1)
  • nodes/test/test_llm_nemotron_think_strip.py

📝 Walkthrough

Walkthrough

Adds an llm_nemotron node for NVIDIA Nemotron models. It supports cloud and self-hosted profiles, OpenAI-compatible API access, reasoning-output cleanup, model synchronization, CI secret wiring, catalog documentation, and live API validation.

Changes

Nemotron integration

Layer / File(s) Summary
Node contract and profiles
nodes/src/nodes/llm_nemotron/services.json, nodes/src/nodes/llm_nemotron/__init__.py, nodes/src/nodes/llm_nemotron/IInstance.py, nodes/src/nodes/llm_nemotron/README.md
Defines Nemotron metadata, cloud and local profiles, configuration fields, pipeline lanes, exports, and usage documentation.
Runtime validation and chat binding
nodes/src/nodes/llm_nemotron/IGlobal.py, nodes/src/nodes/llm_nemotron/nemotron.py, nodes/src/nodes/llm_nemotron/requirements.txt, nodes/test/framework/pipeline.py, nodes/test/test_llm_nemotron_think_strip.py
Adds lifecycle management, NVIDIA endpoint validation, OpenAI-compatible chat creation, local dummy-key handling, reasoning-block removal, dependencies, mock credentials, and unit tests.
Model synchronization and live validation
tools/sync_models/src/providers/nemotron.py, tools/sync_models/src/sync_models.config.json, tools/sync_models/src/sync_models.py, tools/sync_models/test/*, tools/sync_models/README.md
Adds NVIDIA model discovery, Nemotron filtering and token limits, provider registration, conditional live API coverage, and sync documentation.
Credential and catalog wiring
.github/workflows/sync-models.yml, docs/README-nodes.md
Adds ROCKETRIDE_NVIDIA_KEY to synchronization workflow steps and lists Nemotron in the node catalog.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Pipeline
  participant IGlobal
  participant Chat
  participant NVIDIAAPI
  Pipeline->>IGlobal: beginGlobal()
  IGlobal->>Chat: create configured Chat
  Chat->>NVIDIAAPI: invoke Nemotron with questions
  NVIDIAAPI-->>Chat: return response content
  Chat-->>Pipeline: return answers without reasoning blocks
Loading

Possibly related PRs

Suggested labels: module:ai

Suggested reviewers: jmaionchi, rod-christensen, stepmikhaylov

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The implementation covers the requested node, profiles, API integrations, synchronization, filtering, CI wiring, tests, and stripping, but does not show reasoning_content stripping. Add handling and tests for reasoning_content so downstream nodes receive only final answers for both supported reasoning formats.
Docstring Coverage ⚠️ Warning Docstring coverage is 41.18% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary change: adding the NVIDIA Nemotron LLM node.
Out of Scope Changes check ✅ Passed The workflow, documentation, provider integration, configuration, credentials, and tests directly support the linked Nemotron node requirements.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/llm-nemotron

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@nodes/src/nodes/llm_nemotron/nemotron.py`:
- Around line 85-88: Update _THINK_BLOCK_RE and _chat so a <think> block is
removed through either its closing </think> tag or the end of results.content
when the response is truncated. Preserve normal response text after closed
blocks, and add a test covering an unterminated reasoning block at the token
limit.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: da564ac1-2807-46cb-a94b-f57a37e31092

📥 Commits

Reviewing files that changed from the base of the PR and between db6c882 and 35e72e8.

⛔ Files ignored due to path filters (1)
  • nodes/src/nodes/llm_nemotron/nemotron.svg is excluded by !**/*.svg
📒 Files selected for processing (16)
  • .github/workflows/sync-models.yml
  • docs/README-nodes.md
  • nodes/src/nodes/llm_nemotron/IGlobal.py
  • nodes/src/nodes/llm_nemotron/IInstance.py
  • nodes/src/nodes/llm_nemotron/README.md
  • nodes/src/nodes/llm_nemotron/__init__.py
  • nodes/src/nodes/llm_nemotron/nemotron.py
  • nodes/src/nodes/llm_nemotron/requirements.txt
  • nodes/src/nodes/llm_nemotron/services.json
  • nodes/test/framework/pipeline.py
  • tools/sync_models/README.md
  • tools/sync_models/src/providers/nemotron.py
  • tools/sync_models/src/sync_models.config.json
  • tools/sync_models/src/sync_models.py
  • tools/sync_models/test/markers.py
  • tools/sync_models/test/test_sync_live.py

Comment thread nodes/src/nodes/llm_nemotron/nemotron.py Outdated
…erations

A generation that hits max_tokens mid-reasoning emits no closing </think>
tag; make the closing tag optional so partial reasoning never leaks
downstream. Add unit tests for terminated, unterminated, multiple, and
absent think blocks (stub-loaded, no heavy deps).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@nodes/test/test_llm_nemotron_think_strip.py`:
- Line 18: Add a concise PEP 257 docstring to the _load_nemotron helper
describing that it stubs dependencies and dynamically loads the Nemotron module
under test. Keep the helper’s behavior unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 00c45cff-cdc0-45ff-83c9-bd5b67d47127

📥 Commits

Reviewing files that changed from the base of the PR and between 35e72e8 and ee80a33.

📒 Files selected for processing (2)
  • nodes/src/nodes/llm_nemotron/nemotron.py
  • nodes/test/test_llm_nemotron_think_strip.py

Comment thread nodes/test/test_llm_nemotron_think_strip.py
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
asclearuc
asclearuc previously approved these changes Jul 31, 2026

@asclearuc asclearuc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Leela8256 for this — it is a clean, well-scoped addition that mirrors the llm_kimi node template closely (profiles, the IGlobal save-time probe, the shared _format_error), ships four <think>-strip unit tests plus the engine mock test, and wires up the sync provider and CI secret in step with the existing providers.

Approving. One non-blocking should fix inline on nemotron.py about the _chat override dropping agent stop sequences (delegate to super()._chat()).

The one CodeRabbit 🟠 Major finding (unterminated <think> at max_tokens, #1766 (comment)) is already addressed at this head — the regex now matches (?:</think>|$) and a truncated-response test covers it — so it does not block.

Comment thread nodes/src/nodes/llm_nemotron/nemotron.py Outdated
Co-authored-by: Alexandru Sclearuc <asclearuc@gmail.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
nodes/src/nodes/llm_nemotron/nemotron.py (1)

64-77: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Use exact host validation before sending the NVIDIA API key.

At Line 76, serverbase is classified as a cloud endpoint with substring matching. A custom URL such as https://attacker.example/api.nvidia.com/v1 can therefore receive the real NVIDIA key through ChatOpenAI. Uppercase and look-alike hosts are also misclassified.

Parse the URL, allowlist the exact approved NVIDIA hostname and HTTPS scheme, and reuse the same predicate in nodes/src/nodes/llm_nemotron/IGlobal.py so validation and runtime use the same credential boundary.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@nodes/src/nodes/llm_nemotron/nemotron.py` around lines 64 - 77, Replace the
substring check in the Nemotron credential guard around serverbase and apikey
with a URL-based predicate that requires HTTPS and the exact approved NVIDIA
hostname, rejecting attacker-controlled paths, look-alike hosts, and incorrect
casing as cloud endpoints. Define or reuse this predicate in IGlobal.py and
apply the same logic in nemotron.py so validation and ChatOpenAI runtime
credential handling share one credential boundary.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@nodes/src/nodes/llm_nemotron/nemotron.py`:
- Around line 64-77: Replace the substring check in the Nemotron credential
guard around serverbase and apikey with a URL-based predicate that requires
HTTPS and the exact approved NVIDIA hostname, rejecting attacker-controlled
paths, look-alike hosts, and incorrect casing as cloud endpoints. Define or
reuse this predicate in IGlobal.py and apply the same logic in nemotron.py so
validation and ChatOpenAI runtime credential handling share one credential
boundary.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: a0cd06f9-f5a0-4a9c-8c62-f54f016a2bdd

📥 Commits

Reviewing files that changed from the base of the PR and between 1ec7454 and e7ac4bf.

📒 Files selected for processing (1)
  • nodes/src/nodes/llm_nemotron/nemotron.py

…tion

The node's _chat now delegates the model call to ChatBase._chat (which
forwards agent stop sequences); teach the test stub the same method so
the tests exercise the delegated call path.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Leela8256

Copy link
Copy Markdown
Collaborator Author

CI failure after e7ac4bf explained and fixed in 46cfe6e: the think-strip unit tests stub ChatBase (to avoid heavy imports), and the stub predated the super()._chat() delegation — so all four tests hit AttributeError: 'super' object has no attribute '_chat' on every platform. The stub now mirrors the real ChatBase._chat (invoke the LLM, return content), so the tests exercise the delegated call path the review asked for. All four tests pass locally; no product-code changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/cd CI/CD and build system docs Documentation feature New feature or enhancement module:nodes Python pipeline nodes nodes Pipeline nodes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(nodes): add NVIDIA Nemotron LLM node

2 participants